package com.design.decorator.text;

// 压缩装饰者类，实现了装饰者接口
class CompressionDecorator implements TextEditorDecorator {
    private TextEditor textEditor;

    public CompressionDecorator(TextEditor textEditor) {
        this.textEditor = textEditor;
    }

    @Override
    public void open(String fileName) {
        textEditor.open(fileName);
    }

    @Override
    public void save() {
        textEditor.save();
    }

    @Override
    public void edit() {
        textEditor.edit();
    }

    public void compress() {
        System.out.println("Compressing file: " + textEditor);
    }
}

